package com.tianyadu.multi_module_demo.controller;

import com.tianyadu.multi_module_demo.common.utils.ResultVOUtil;
import com.tianyadu.multi_module_demo.common.vo.ResultVO;
import com.tianyadu.multi_module_demo.domain.ProductInfo;
import com.tianyadu.multi_module_demo.service.ProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @FileName: ProductInfoController
 * @Description:
 * @author: xueyj
 * @create: 2018-11-24 09:45
 */
@RestController
@RequestMapping("/product")
public class ProductInfoController {

    @Autowired
    private ProductInfoService productInfoService;

    @GetMapping("/list")
    public ResultVO<List<ProductInfo>> findProductVOList() {
        List<ProductInfo> productInfos = productInfoService.findAllUp();
        return ResultVOUtil.success(productInfos);
    }
}